import { useEffect } from 'react';
import styles from './index.less';
import { Button } from 'antd';
// import {request} from 'umi'
import { usersList,usersAdd } from '@/api/uses';
export default function IndexPage() {
  // const getUsers=async ()=>{
  //   let res=await request("/api/users/list")
  //   console.log(res)
  // }
  const getUsers = async () => {
    let res = await usersList()
    console.log(res,123)
  }
  const usersCreate=async ()=>{
    let res=await usersAdd({name:"123",age:'23'})
    let ress=await usersAdd({name:"123",age:'223'})
    let resss=await usersAdd({name:"123",age:'323'})
    let ressss=await usersAdd({name:"123",age:'423'})
    // console.log(res,456)
  }


  useEffect(() => {
    getUsers()
  }, [])
  return (
    <div>
      <button>按钮</button>
      <Button type="primary"  onClick={usersCreate}>按钮</Button>
      <h1 className={styles.title}>Page index</h1>
    </div>
  );
}
